package eSchool.DataLayer;

import java.io.File;
import java.sql.Connection;

public class AccessDAOFactory extends DAOFactory {

    public static final String DRIVER = "sun.jdbc.odbc.JdbcOdbcDriver";
    public static final String DBURL = "jdbc:odbc:DRIVER={Microsoft access Driver (*.mdb)}; DBQ=";
    //public static String fileName = "H:\\UAL\\Ano_2\\Semestre_2\\PP\\Projecto_Final\\Parte_1\\E-School\\src\\eSchool\\Data\\E-School.mdb";
    //public static String fileName="C:\\Documents and Settings\\Luis.Zeferino\\My Documents\\UAL\\2_Ano\\2_Semestre\\PP\\Projecto\\Parte_1\\WebProject\\E-School\\src\\eSchool\\Data\\E-School.mdb";
    //public static String fileName="C:\\Documents and Settings\\TT0578\\My Documents\\NetBeansProjects\\E-School\\src\\eSchool\\Data\\E-School.mdb";
    public static String fileName= new File("").getAbsolutePath() + "\\src\\eSchool\\Data\\E-School.mdb";
    
    public static Connection createConnection() throws Exception {
            return DBUtils.openAccessCon(DRIVER, DBURL + fileName);
    }

    public IAlunoDAO getAlunoDAO() {

        return new AccessAlunoDAO();
    }
    
    public IDocenteDAO getDocenteDAO() {

        return new AccessDocenteDAO();
    }
    
    public IFuncionarioDAO getFuncionarioDAO() {

        return new AccessFuncionarioDAO();
    }
    
    public IDisciplinaDAO getDisciplinaDAO() {

        return new AccessDisciplinaDAO();
    }
    
    public IUtilizadorDAO getUtilizadorDAO() {

        return new AccessUtilizadorDAO();
    }
    
    public IGrupoUtilizadoresDAO getGrupoUtilizadoresDAO() {

        return new AccessGrupoUtilizadoresDAO();
    }

    public IAlunoInscritoDAO getAlunoInscritoDAO() {
        return new AccessAlunoInscritoDAO();
    }
    
     public IDisciplinaInscritoDAO getDisciplinaInscritoDAO() {
        return new AccessDisciplinasInscritoDAO();
    }
}
